using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Outpatient.Doman.Hospitalization
{
    /// <summary>
    /// 患者住院登记表
    /// </summary>
    [Table("PatientAdmission")]
    public class PatientAdmission
    {
        /// <summary>
        /// 住院登记唯一标识,主键,自增
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int AdmissionId { get; set; }

        /// <summary>
        /// 患者卡号，标识患者
        /// </summary>
        [Required]
        [StringLength(20)]
        public string Patient { get; set; } = string.Empty;

        /// <summary>
        /// 关联科室表的外键,标识患者所属科室
        /// </summary>
        public int DepartmentId { get; set; }

        /// <summary>
        /// 关联病房表的外键,标识患者入住的病房
        /// </summary>
        public int RoomId { get; set; }

        /// <summary>
        /// 关联病床表的外键,标识患者入住的具体病床
        /// </summary>
        public int HospitalId { get; set; }

        /// <summary>
        /// 患者预交的费用金额(单位:元)
        /// </summary>
        [Column(TypeName = "decimal(10,2)")]
        public decimal Prepayment { get; set; }

        /// <summary>
        /// 患者的病情详细描述
        /// </summary>
        [Column(TypeName = "text")]
        public string ConditionDesc { get; set; } = string.Empty;

        /// <summary>
        /// 患者对某些药物的禁忌情况
        /// </summary>
        [Column(TypeName = "text")]
        public string DrugContraindications { get; set; } = string.Empty;

        /// <summary>
        /// 患者入院时间
        /// </summary>
        public DateTime AdmissionTime { get; set; } = DateTime.Now;


        /// <summary>
        /// 是否出院  false未出  true一出
        /// </summary>
        public bool? Status {  get; set; }=false;


        /// <summary>
        /// 逻辑删除、默认0未删除 1已删除
        /// </summary>
        public bool IsDelete { get; set; } = false;
    }
} 